import store from '@/store'

export default {
  methods: {
    checkPermission(key) {
      // 从vuex取用户信息

      const { userInfo } = store.state.user
      // 判断userInfo信息是否有权限点
      if (userInfo.roles.points && userInfo.roles.points.length) {
        return userInfo.roles.points.some((item) => item === key)
      }
      return false
    },
  },
}
